<!--
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				WeeklyExceptionReport.jsp
  //	TITLE:				
  //	FUNCTION:			
  //	BY:					Beyes Xia
  //	DATE:				2004-4-8 20:46
  // --------------------------------------------------------------
-->

<html>
<%@ include file="../tssheader.jsp" %>
<%@ page import="java.util.*" %>
<%@ page import="java.lang.*" %>
<%@ page import="tss.weeklytimesheet.*" %>
<%
	String staffNo = request.getParameter("staff_no");
	String userName = request.getParameter("user_name");
	String begin_date = request.getParameter("date_from");
	String end_date = request.getParameter("date_to");
	
	session.setAttribute("weekly_begin_from",begin_date);
	session.setAttribute("weekly_end_from",end_date);
	
	ArrayList week = (ArrayList)request.getAttribute("week");
	Hashtable spend = (Hashtable)request.getAttribute("spend");
	
	//System.out.println("week:"+week);
	//System.out.println("spend:"+spend.toString());
	
	RestrictDate rd = new RestrictDate();	
%>
<body>
<h2>Time Sheet Weekly Sum List</h2> 
<table>
<tr>		
	<td>Staff No.: </td>
	<td><%= staffNo %></td>
</tr>
<tr>		
	<td>Staff Name: </td>
	<td><%= userName %></td>
</tr>
<tr>		
	<td>Date From: </td>
	<td><%= begin_date %></td>
</tr>
<tr>
	<td>Date To: </td>
	<td><%= end_date %></td>
</tr>
</table>

<br>

<table border=1>
<%
	for(int i=0;i<week.size();i++)
	{
%>
<tr>
<%
		if(rd.isValidDate((String)week.get(i)))
		{
%>
	<td nowrap>
		<a href='<%=contextPath%>/tss/weeklytimesheet/midway.jsp?search_date=<%= week.get(i) %>'><b><%= week.get(i) %></b></a>
	</td>
<%
		}
		else
		{
%>
	<td nowrap>
		<b><%= week.get(i) %></b>
	</td>			
<%
		}
		String spendHours = "";
		if(spend.get(week.get(i))!= null)
				spendHours = (String)spend.get(week.get(i));
		else
				spendHours = "&nbsp";
			
		if(spendHours.equals("&nbsp"))
		{
%>
	<td nowrap style="background:#B0C4DE;width:50;" align=right>
		<font color=#000000><%= spendHours %></font>
	</td>
<%		
		}
		else
		{
			float spendHoursF = Float.parseFloat(spendHours);
			if(spendHoursF!=40)
			{
%>
	<td nowrap style="background:#B0C4DE;width:50;" align=right>
		<font color=#000000><b><%= spendHours %><b></font>
	</td>
<%
			}
			else
			{
%>
	<td nowrap align=right style="width:50;">
		<%= spendHours %>
	</td>
<%
			}
		}
%>	
</tr>
<%	}	%>

</table>

<br>
<hr>
<p>
<INPUT type=button value=Back onclick="location.href='<%=contextPath%>/tss/weeklytimesheet/WeeklyTSSearch.jsp'">
</p>
</body>
<%@ include file="../tssfooter.jsp" %>
</html>

